package com.woniuxy.dal.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDate;
import lombok.Data;

/**
 * 靶场表
 * @TableName ranges
 */
@TableName(value ="ranges")
@Data
public class Ranges implements Serializable {
    /**
     * 靶场Id
     */
    @TableId(value = "rangeId", type = IdType.AUTO)
    private Integer rangeId;

    /**
     * 靶场名字
     */
    @TableField(value = "rangeName")
    private String rangeName;

    /**
     * 靶场详情
     */
    @TableField(value = "rangeDetail")
    private String rangeDetail;

    /**
     * 靶场类别
     */
    @TableField(value = "rangeType")
    private Integer rangeType;

    /**
     * 实验文件路径
     */
    @TableField(value = "testFilePath")
    private String testFilePath;

    /**
     * 过程解析
     */
    @TableField(value = "process")
    private String process;

    /**
     * 累计访问人数
     */
    @TableField(value = "visitorsCount")
    private Integer visitorsCount;

    /**
     * 难度：1(简单)，2(中等)，3(困难)
     */
    @TableField(value = "difficulty")
    private Integer difficulty;

    /**
     * 文件类型: 1(镜像)，2(war包)，3(zip), 4(普通文件)
     */
    @TableField(value = "fileType")
    private Integer fileType;

    /**
     * 创建时间
     */
    @TableField(value = "createTime")
    private LocalDate createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Ranges other = (Ranges) that;
        return (this.getRangeId() == null ? other.getRangeId() == null : this.getRangeId().equals(other.getRangeId()))
            && (this.getRangeName() == null ? other.getRangeName() == null : this.getRangeName().equals(other.getRangeName()))
            && (this.getRangeDetail() == null ? other.getRangeDetail() == null : this.getRangeDetail().equals(other.getRangeDetail()))
            && (this.getRangeType() == null ? other.getRangeType() == null : this.getRangeType().equals(other.getRangeType()))
            && (this.getTestFilePath() == null ? other.getTestFilePath() == null : this.getTestFilePath().equals(other.getTestFilePath()))
            && (this.getProcess() == null ? other.getProcess() == null : this.getProcess().equals(other.getProcess()))
            && (this.getVisitorsCount() == null ? other.getVisitorsCount() == null : this.getVisitorsCount().equals(other.getVisitorsCount()))
            && (this.getDifficulty() == null ? other.getDifficulty() == null : this.getDifficulty().equals(other.getDifficulty()))
            && (this.getFileType() == null ? other.getFileType() == null : this.getFileType().equals(other.getFileType()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRangeId() == null) ? 0 : getRangeId().hashCode());
        result = prime * result + ((getRangeName() == null) ? 0 : getRangeName().hashCode());
        result = prime * result + ((getRangeDetail() == null) ? 0 : getRangeDetail().hashCode());
        result = prime * result + ((getRangeType() == null) ? 0 : getRangeType().hashCode());
        result = prime * result + ((getTestFilePath() == null) ? 0 : getTestFilePath().hashCode());
        result = prime * result + ((getProcess() == null) ? 0 : getProcess().hashCode());
        result = prime * result + ((getVisitorsCount() == null) ? 0 : getVisitorsCount().hashCode());
        result = prime * result + ((getDifficulty() == null) ? 0 : getDifficulty().hashCode());
        result = prime * result + ((getFileType() == null) ? 0 : getFileType().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", rangeId=").append(rangeId);
        sb.append(", rangeName=").append(rangeName);
        sb.append(", rangeDetail=").append(rangeDetail);
        sb.append(", rangeType=").append(rangeType);
        sb.append(", testFilePath=").append(testFilePath);
        sb.append(", process=").append(process);
        sb.append(", visitorsCount=").append(visitorsCount);
        sb.append(", difficulty=").append(difficulty);
        sb.append(", fileType=").append(fileType);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}